namespace DotNetNuke.Services.Cache.BroadcastPollingCachingProvider.Data
{
    using DotNetNuke.Framework;
    using System;
    using System.Data;

    public abstract class DataProvider
    {
        private static DataProvider objProvider = null;
        private const string ProviderAssemblyName = "DotNetNuke.Caching.BroadcastPollingCachingProvider";
        private const string ProviderNamespace = "DotNetNuke.Services.Cache.BroadcastPollingCachingProvider.Data";
        private const string ProviderType = "data";

        static DataProvider()
        {
            CreateProvider();
        }

        public abstract int AddBroadcast(string BroadcastType, string BroadcastMessage, string ServerName);
        public abstract void AddCachedObject(string Key, string Value, string ServerName);
        private static void CreateProvider()
        {
            objProvider = (DataProvider) Reflection.CreateObject("data", "DotNetNuke.Services.Cache.BroadcastPollingCachingProvider.Data", "DotNetNuke.Caching.BroadcastPollingCachingProvider");
        }

        public abstract void DeleteCachedObject(string Key);
        public abstract IDataReader GetBroadcasts(string ServerName);
        public abstract IDataReader GetCachedObject(string Key);
        public static DataProvider Instance()
        {
            return objProvider;
        }
    }
}

